#include <iostream>
#include <boost/smart_ptr/shared_ptr.hpp>
#include "HttpReceiver.h"

HttpReceiver::HttpReceiver(std::string const& agentName) : AgentBase(agentName)
{
}

void HttpReceiver::acceptSubUrl(std::string const& method, std::string const& url)
{
	com::Block block;
	com::Subscription* subscription(block.mutable_subscription());
	subscription->set_agentname(getAgentName());

//	subscription->set_agentport(m_agent_port);
	subscription->set_dst_port(80);

	com::Http* http(subscription->mutable_http());
	http->set_httprequesttype(method);
	http->set_url(url);

	sendString(block);
}
